<?php

//use Illuminate\Http\Request;
//
///*
//|--------------------------------------------------------------------------
//| API Routes
//|--------------------------------------------------------------------------
//|
//| Here is where you can register API routes for your application. These
//| routes are loaded by the RouteServiceProvider within a group which
//| is assigned the "api" middleware group. Enjoy building your API!
//|
//*/
//
//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//}
//定义登录

//定义api 默认前缀api 登录 获取token
Route::post('login','Api\LoginController@login');
//符合restful 标准
// http://laraveltest.com/api/v1/users
//url 独立域名 前缀 api
//版本号  v1
//结果用名词 不用动词
//内容可以使用  rsa 非对称加密 进行 安装  白名单
//安全 数据 加密
//$data =base64_encode(base64_encode("aaaa12346bbbb"));
Route::group(["middleware"=>"auth:api","prefix"=>"v1","namespace"=>"Api"],function (){
    Route::get("users",function (){
        return "1231";
    });
    //小程序登录
    Route::post("wxlogin",'LoginController@wxlogin');
    //用户信息
    Route::post("user/userinfo",'UserController@userinfo');
});
